package com.zhixing.web.service.impl;

import com.zhixing.web.api.dataobject.entity.Menu;
import com.zhixing.web.api.dataobject.entity.Rotation;
import com.zhixing.web.repository.MenuRepository;
import com.zhixing.web.repository.RotationRepository;
import com.zhixing.web.service.MenuService;
import com.zhixing.web.service.RotationService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author dzh
 * @version 1.0.0.05020
 * <p>project: d-blog</p>
 * <p>created time: 2022/05/09 15:32</p>
 * <p>describe: 菜单信息逻辑实现层</p>
 * <p>remarks: </p>
 **/
@Service
public class MenuServiceImpl implements MenuService {


    @Resource
	private MenuRepository menuRepository;


    @Override
    public List<Menu> getMenuList(Menu menu) {

        return menuRepository.findAll(menu);
    }

    @Override
    public List<Menu> getMenuListByPage(Menu menu, int pageNum, int pageSize) {

        return menuRepository.findAllForPage(menu,  (pageNum - 1) * pageSize , pageSize);
    }
}
